﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameSDK.Player;
using GuessNumberGame.Board;

namespace GuessNumberGame.Player
{
    public class StupidStrategy : GuessNumberStrategy
    {


        public StupidStrategy(GuessNumberPlayer player)
            : base(player)
        {
        }

        public override void DoMove()
        {
            int proposal = this.Board.Alea.Next(this.Board.LowerBound, this.Board.UpperBound);
            Console.WriteLine(this.Player + " : " + proposal);

            GuessNumberMove move = new GuessNumberMove(((GuessNumberBoard)Player.Board), proposal);

            if (move.EvaluateMove() > 0)
            {
                Console.WriteLine(Player.GamePlayerId + " : -");
                this.Board.PlayerMoved(Player, move);
            }
            else if (move.EvaluateMove() < 0)
            {
                Console.WriteLine(Player.GamePlayerId + " : +");
                this.Board.PlayerMoved(Player, move);
            }
            else
            {
                Console.WriteLine(Player.GamePlayerId + " : win");
            }
  
        }
    }
}
